package com.audaque.jadmin.system.service.impl;

import java.util.List;

import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.audaque.jadmin.common.service.impl.BaseServiceImpl;
import com.audaque.jadmin.system.dao.mybatis.RoleMapper;
import com.audaque.jadmin.system.dao.mybatis.UserMapper;
import com.audaque.jadmin.system.model.Role;
import com.audaque.jadmin.system.model.User;
import com.audaque.jadmin.system.service.UserService;

/**
 * @Description :
 * @FileName: UserServiceImpl.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年10月10日 下午3:27:36
 * @Version:V1.00
 */
@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private RoleMapper roleMapper;

	public User findById(Integer id) {
		return userMapper.findById(id);
	}

	@Override
	public User findByAccount(String account) {
		return userMapper.findByAccount(account);
	}

	@Override
	public SimpleAuthorizationInfo getAccountRolePermission(int userId) {
		return null;
	}

	@Override
	public List<Role> queryUserRoles(Integer userId) {
		return roleMapper.findByUserId(userId);
	}

}
